public class ReflectClassDemo {
//    首先要拿到一个对象，再实例化对象
    public static void reflectNewInstance(){
        Class<?> stuClass = null;
        try {
            stuClass = Class.forName("Student");
            Student student = (Student)stuClass.newInstance();
            System.out.println(student);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
    public static void main(String[] args) {
        reflectNewInstance();

    }
}
